package com.chen.springboot.controller.uniapp;

import com.chen.springboot.dto.uniapp.Banner;
import com.chen.springboot.service.BannerService;
import com.chen.springboot.common.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = {"轮播图接口"})
@RestController
@RequestMapping("/api")
public class BannerController {
    @Autowired
    private BannerService bannerService;

    @GetMapping("/banners")
    @ApiOperation("轮播图列表")
    public Result<List<Banner>> getBanners() {
        List<Banner> list = bannerService.getAllBanners();
        return Result.success(list);
    }
}
